package com.atguigu.JVMDay01;

import java.util.concurrent.atomic.AtomicLong;

public class StackRecurrenceDemo {
    //多线程环境下使用原子类，为了保证线程安全
    private static AtomicLong atomiclong = new AtomicLong(0);
    public static void test(){
        System.out.println(atomiclong.getAndIncrement());//相当于i++
        test();
    }

    public static void main(String[] args) {
        StackRecurrenceDemo.test();
    }
}
